package com.googlecode.bipol.war.services;

import java.io.Serializable;
import java.util.List;

import com.googlecode.bip.entity.ITopic;

public interface TopicManager extends Serializable {
    /**
    * Create a new topic
    *
    * @param name The name of the topic
    * @param description The description of the topic
    * @param idLocal Code id for localization
    * @return ITopic
    */
    public ITopic createTopic(String name, String description, String idLocal) throws ServiceException;
    
    /**
     * Create or update a topic
     * If the idTopic is set to 0, a new topic will be created
     * Otherwise, the topic with idTopic will be updated, if it exists
     * @param topic The topic model
     * @return The created/updated topic
     * @throws ServiceException If the topic does not exist (assuming it's id is different than zero) 
     */
    public ITopic postTopic(ITopic topic) throws ServiceException;
    
    /**
    * Remove an existing topic
    *
    * @param idtopic The id of the topic
    * @param idlocal Code id for localization
    * @return ITopic The removed topic
    */
    public ITopic removeTopic(int idtopic, String idlocal) throws ServiceException;

    /**
    * Get all the existing topics created so far
    *
    * @return The list of topics
    * @throws ServiceException
    */
    public List<ITopic> getAllTopics() throws ServiceException;

}
